﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Duality;
using OpenTK;
using OpenTK.Input;

namespace PhoenixCrab.Cameras
{
    [Serializable]
    public class CameraMotion : Component, ICmpUpdatable
    {
        public float ScrollSpeed { get; set; }

        public void OnUpdate()
        {
            if (DualityApp.Keyboard.KeyPressed(Key.D))
            {
                GameObj.Transform.Pos += new Vector3(ScrollSpeed, 0, 0);
            }
            else if (DualityApp.Keyboard.KeyPressed(Key.A))
            {
                GameObj.Transform.Pos -= new Vector3(ScrollSpeed, 0, 0);
            }
            else if (DualityApp.Keyboard.KeyPressed(Key.W))
            {
                GameObj.Transform.Pos -= new Vector3(0, ScrollSpeed, 0);
            }
            else if (DualityApp.Keyboard.KeyPressed(Key.S))
            {
                GameObj.Transform.Pos += new Vector3(0, ScrollSpeed, 0);
            }
        }
    }
}